<md-card>
    <table ng-if="settings" class="table">
        <tr>
            <th>Verbose Mode</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false"
                    ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.verbose"
                    ng-click="switchsettings('verbose')" aria-label="verbosity change">
                    <span ng-if="selectedCluster.config.verbose" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.verbose" class="label label-warning">Off</span>

                </md-switch>
            </td>
        </tr>
        <tr>
            <th>Log SQL in Monitoring</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false"
                    ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.logSqlInMonitoring"
                    ng-click="switchsettings('log-sql-in-monitoring')" aria-label="verbosity change">
                    <span ng-if="selectedCluster.config.logSqlInMonitoring" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.logSqlInMonitoring" class="label label-warning">Off</span>

                </md-switch>
            </td>
        </tr>
        <tr>
            <th>Log to SysLog</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false"
                    ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.logSyslog"
                    ng-click="switchsettings('log-syslog')" aria-label="verbosity change">
                    <span ng-if="selectedCluster.config.logSyslog" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.logSyslog" class="label label-warning">Off</span>

                </md-switch>
            </td>
        </tr>
    </table>
</md-card>
<md-card>
    <table ng-if="settings" class="table">
        <tr>
            <th>Log Level</th>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logLevel"
                    ng-change="setsettings('log-level',selectedCluster.config.logLevel)" step="1" min="0" max="4"
                    round="0" aria-label="log level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logLevel == 0" class="label label-default"> NO LOGGING </span>
                <span ng-if="selectedCluster.config.logLevel >= 1" class="label label-danger"> ERROR </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logLevel >= 2" class="label label-warning"> WARNING </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logLevel >= 3" class="label label-info"> INFO </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
    </table>
</md-card>
<md-card>
    <table ng-if="settings" class="table">
        <tr>
            <th>Toggle Log Level Per Module</th>
        </tr>
        <tr>
            <td>Log DB Jobs</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logTaskLevel"
                    ng-change="setsettings('log-task-level',selectedCluster.config.logTaskLevel)"
                    step="1" min="0" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logTaskLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logTaskLevel >= 1" class="label label-danger"> ERROR
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logTaskLevel >= 2" class="label label-warning"> WARNING
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logTaskLevel >= 3" class="label label-info"> INFO </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logTaskLevel >= 4" class="label label-primary"> DEBUG
                </span>
            </td>
        </tr>
        <tr>
            <td>Log writer election</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logWriterElectionLevel"
                    ng-change="setsettings('log-writer-election-level',selectedCluster.config.logWriterElectionLevel)"
                    step="1" min="0" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logWriterElectionLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logWriterElectionLevel >= 1" class="label label-danger"> ERROR
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logWriterElectionLevel >= 2" class="label label-warning"> WARNING
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logWriterElectionLevel >= 3" class="label label-info"> INFO </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logWriterElectionLevel >= 4" class="label label-primary"> DEBUG
                </span>
            </td>
        </tr>
        <tr>
            <td>Log SST</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logSstLevel"
                    ng-change="setsettings('log-sst-level',selectedCluster.config.logSstLevel)" step="1" min="0" max="4"
                    round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logSstLevel == 0" class="label label-default"> NO LOGGING </span>
                <span ng-if="selectedCluster.config.logSstLevel >= 1" class="label label-danger"> ERROR </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logSstLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logSstLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logSstLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log HeartBeat</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logHeartbeatLevel"
                    ng-change="setsettings('log-heartbeat-level',selectedCluster.config.logHeartbeatLevel)" step="1"
                    min="0" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logHeartbeatLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logHeartbeatLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logHeartbeatLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logHeartbeatLevel >= 3" class="label label-info"> INFO </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logHeartbeatLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log Config Load</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logConfigLoadLevel"
                    ng-change="setsettings('log-config-load-level',selectedCluster.config.logConfigLoadLevel)" step="1" min="0"
                    max="4" round="0" aria-label="Log Config Load Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logConfigLoadLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logConfigLoadLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logConfigLoadLevel >= 2" class="label label-warning"> WARNING
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logConfigLoadLevel >= 3" class="label label-info"> INFO </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logConfigLoadLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log GIT</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logGitLevel"
                    ng-change="setsettings('log-git-level',selectedCluster.config.logGitLevel)" step="1" min="0" max="4"
                    round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logGitLevel == 0" class="label label-default"> NO LOGGING </span>
                <span ng-if="selectedCluster.config.logGitLevel >= 1" class="label label-danger"> ERROR </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logGitLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logGitLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logGitLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log Backup Stream</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logBackupStreamLevel"
                    ng-change="setsettings('log-backup-stream-level',selectedCluster.config.logBackupStreamLevel)"
                    step="1" min="1" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logBackupStreamLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logBackupStreamLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logBackupStreamLevel >= 2" class="label label-warning"> WARNING
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logBackupStreamLevel >= 3" class="label label-info"> INFO </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logBackupStreamLevel >= 4" class="label label-primary"> DEBUG
                </span>
            </td>
        </tr>
        <tr>
            <td>Log Orchestrator</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logOrchestratorLevel"
                    ng-change="setsettings('log-orchestrator-level',selectedCluster.config.logOrchestratorLevel)"
                    step="1" min="1" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logOrchestratorLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logOrchestratorLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logOrchestratorLevel >= 2" class="label label-warning"> WARNING
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logOrchestratorLevel >= 3" class="label label-info"> INFO </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logOrchestratorLevel >= 4" class="label label-primary"> DEBUG
                </span>
            </td>
        </tr>
        <tr>
            <td>Log Vault</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logVaultLevel"
                    ng-change="setsettings('log-vault-level',selectedCluster.config.logVaultLevel)" step="1" min="0"
                    max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logVaultLevel == 0" class="label label-default"> NO LOGGING </span>
                <span ng-if="selectedCluster.config.logVaultLevel >= 1" class="label label-danger"> ERROR </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logVaultLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logVaultLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logVaultLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log Topology Detection</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logTopologyLevel"
                    ng-change="setsettings('log-topology-level',selectedCluster.config.logTopologyLevel)" step="1"
                    min="0" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logTopologyLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logTopologyLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logTopologyLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logTopologyLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logTopologyLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log Graphite</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logGraphiteLevel"
                    ng-change="setsettings('log-graphite-level',selectedCluster.config.logGraphiteLevel)" step="1"
                    min="0" max="4" round="0" aria-label="Log Graphite Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logGraphiteLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logGraphiteLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logGraphiteLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logGraphiteLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logGraphiteLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log Binlog Purge</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logBinlogPurgeLevel"
                    ng-change="setsettings('log-binlog-purge-level',selectedCluster.config.logBinlogPurgeLevel)"
                    step="1" min="0" max="4" round="0" aria-label="Log Binlog Purge Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logBinlogPurgeLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.logBinlogPurgeLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logBinlogPurgeLevel >= 2" class="label label-warning"> WARNING
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logBinlogPurgeLevel >= 3" class="label label-info"> INFO </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logBinlogPurgeLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
    </table>
</md-card>
<md-card>
    <table ng-if="settings" class="table">
        <tr>
            <th>Log Proxy</th>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.logProxyLevel"
                    ng-change="setsettings('log-proxy-level',selectedCluster.config.logProxyLevel)" step="1" min="0"
                    max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.logProxyLevel == 0" class="label label-default"> NO LOGGING </span>
                <span ng-if="selectedCluster.config.logProxyLevel >= 1" class="label label-danger"> ERROR </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logProxyLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.logProxyLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.logProxyLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log HAProxy</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.haproxyLogLevel"
                    ng-change="setsettings('haproxy-log-level',selectedCluster.config.haproxyLogLevel)" step="1" min="0"
                    max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.haproxyLogLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.haproxyLogLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.haproxyLogLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.haproxyLogLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.haproxyLogLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log ProxySQL</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.proxysqlLogLevel"
                    ng-change="setsettings('proxysql-log-level',selectedCluster.config.proxysqlLogLevel)" step="1"
                    min="0" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.proxysqlLogLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.proxysqlLogLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.proxysqlLogLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.proxysqlLogLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.proxysqlLogLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
        <tr>
            <td>Log Proxy Janitor</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.proxyjanitorLogLevel"
                    ng-change="setsettings('proxyjanitor-log-level',selectedCluster.config.proxyjanitorLogLevel)"
                    step="1" min="1" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.proxyjanitorLogLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.proxyjanitorLogLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.proxyjanitorLogLevel >= 2" class="label label-warning"> WARNING
                </span> &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.proxyjanitorLogLevel >= 3" class="label label-info"> INFO </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.proxyjanitorLogLevel >= 4" class="label label-primary"> DEBUG
                </span>
            </td>
        </tr>
        <tr>
            <td>Log Maxscale</td>
        </tr>
        <tr>
            <td><md-slider ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" md-discrete
                    flex ng-model="selectedCluster.config.maxscaleLogLevel"
                    ng-change="setsettings('maxscale-log-level',selectedCluster.config.maxscaleLogLevel)" step="1"
                    min="0" max="4" round="0" aria-label="Log writer election Level"></md-slider></td>
        </tr>
        <tr>
            <td>
                <span ng-if="selectedCluster.config.maxscaleLogLevel == 0" class="label label-default"> NO LOGGING
                </span>
                <span ng-if="selectedCluster.config.maxscaleLogLevel >= 1" class="label label-danger"> ERROR </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.maxscaleLogLevel >= 2" class="label label-warning"> WARNING </span>
                &nbsp; &nbsp;
                <span ng-if="selectedCluster.config.maxscaleLogLevel >= 3" class="label label-info"> INFO </span> &nbsp;
                &nbsp;
                <span ng-if="selectedCluster.config.maxscaleLogLevel >= 4" class="label label-primary"> DEBUG </span>
            </td>
        </tr>
    </table>
</md-card>